package com.example.payment.messaging.message;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.List;

/**
 * 订单库存预留成功事件消息
 * Topic: order_stock_reserved
 * 
 * @author mall-team
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class OrderStockReservedMessage {

    /**
     * 订单编号
     */
    private String orderNo;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 订单总金额
     */
    private BigDecimal totalAmount;

    /**
     * 预留的库存明细
     */
    private List<ReservedItemInfo> items;

    /**
     * 预留库存明细信息
     */
    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    public static class ReservedItemInfo {
        private Long skuId;
        private String skuName;
        private Integer quantity;
        private BigDecimal price;
    }
}

